<script>
	import Vue from "vue";
	// 引入公共样式
	import "@/common/css/uni.css";
	import "@/common/css/common.styl";
	import "@/common/css/component.styl";
	// 公用函数方法
	import { COMMON_MIXINS } from '@/common/js/mixins.js';
	// 移动端测试打印插件
	var  VConsole = require("@/common/vconsole.min.js");
    export default {
		mixins: [COMMON_MIXINS],    //引入公用函数方法
        onLaunch: function() {
            console.log('App Launch');
            // #ifdef APP-PLUS
            // 检测升级
            uni.request({
                url: 'https://uniapp.dcloud.io/update', //检查更新的服务器地址
                data: {
                    appid: plus.runtime.appid,
                    version: plus.runtime.version,
                    imei: plus.device.imei
                },
                success: (res) => {
                    if (res.statusCode == 200 && res.data.isUpdate) {
                        let openUrl = plus.os.name === 'iOS' ? res.data.iOS : res.data.Android;
                        // 提醒用户更新
                        uni.showModal({
                            title: '更新提示',
                            content: res.data.note ? res.data.note : '是否选择更新',
                            success: (showResult) => {
                                if (showResult.confirm) {
                                    plus.runtime.openURL(openUrl);
                                }
                            }
                        })
                    }
                }
            })
            // #endif
        },
		onLoad() {
			
		},
        onShow: function() {
            console.log('App Show')
        },
        onHide: function() {
            console.log('App Hide')
        },
		globalData: {
			test: ''
		},
		mounted() {
			if (process.env.NODE_ENV === 'development') {
				// 移动端调试才放出来
				// var vConsole = new VConsole();
				// console.log('Hello vConsole');
			}
		},
		methods: {
			
		}
    }
</script>

<style>
    page {
        background-color: #F4F5F6;
        height: 100%;
        font-size: 28upx;
    }
</style>
